#!/usr/bin/env python
from matplotlib.pyplot import *

fin=open('data_big.dat')
tam=open('hard_big_tamanios')
todo=fin.read().strip().split('\n')
#xs=tam.read().split()
constru=[int(x.split()[0]) for x in todo if x]
local=[int(x.split()[1]) for x in todo if x]
xs=tabu=[int(x.split()[2]) for x in todo if x]

title("Comparacion de los algoritmos vs Tabu Search")
xlabel("# Clausulas satisfechas por tabu")
ylabel("fraccion de # Clausulas satisfechas por tabu")
#plot(xs,exacto,'k.',label="exacto")
plot(xs,[constru[i]/float(xs[i]) for i in xrange(len(xs))],'gx',label="constructiva")
plot(xs,[local[i]/float(xs[i]) for i in xrange(len(xs))],'b+',label="busqueda local")
plot(xs,[tabu[i]/float(xs[i]) for i in xrange(len(xs))],'r.',label="tabu")
#plot(xs,[x*5.5+60 for x in xs],label=r"$c \times x$")
legend(loc=0)
ylim(ymax=1.01)
savefig('plot_todos_vs_tabu.png',dpi=640./8)
show()
